package joboo4;

public class job03 {
    public static void main(String[] args) {
        String str="我爱Java!";
        String a="   我爱java   ";

        int len=str.length();
        System.out.println(len);

        a=a.trim();
        System.out.println(a);


        System.out.println(str.toUpperCase());
        System.out.println(str.toLowerCase());

        boolean starts=str.startsWith("我");
        System.out.println(starts);
        boolean ends=str.endsWith("a");
        System.out.println(ends);

        char c=str.charAt(5);
        System.out.println(c);

        int index=str.indexOf("a");
        System.out.println(index);
        index=str.indexOf("a",3);
        System.out.println(index);
        index=str.lastIndexOf("!");
        System.out.println(index);

        String sub=str.substring(1,6);
        System.out.println(sub);
        int A=str.indexOf("我");
        int B=str.lastIndexOf("爱");
        String C=str.substring(A,B);
        System.out.println(C);

        int aa=123;
        String s1=String.valueOf(aa);
        System.out.println(s1);

        double bb=123.456;
        String s2=String.valueOf(bb);
        System.out.println(s2);


    }
}
